package com.example.springbootresourcemodifiersample.interceptor

import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport

@Configuration
 class WebMvcConfig : WebMvcConfigurationSupport() {





    override fun addResourceHandlers(registry:ResourceHandlerRegistry) {
        //将所有D:/resources/目录下的资源,访问时都映射到/image/** 路径下
        registry.addResourceHandler("/image/**")
            .addResourceLocations("classpath:/static/")
    }
}